<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org"
    th:replace="layout/master(title='学生列表')">

<!-- css片段 -->
<th:block th:fragment="css">
    <link rel="stylesheet" href="/css/list.css">
</th:block>

<!-- 内容片段 -->
<div class="container" th:fragment="content">
    <div class="main-title">学生信息表</div>

    <!-- 根据姓名查询   -->
    <form action="http://localhost:8080/student/getbyname" method="get">
        <div class="form-group">
            <label for="InputName">输入名字查询</label>
            <input type="text" class="form-control" id="InputName" placeholder="Name" name="name">
            <button type="submit" class="btn btn-success" >提交</button>
            <a href="http://localhost:8080/student/list" class="btn btn-success">刷新重置</a>
        </div>
    </form>

    <!-- 设计表格 -->
    <table class="table table-striped">
        <thead>
        <tr>
            <th>序号</th>
            <th>学号</th>
            <th>姓名</th>
            <th>密码</th>
            <th>性别</th>
            <th>年龄</th>
            <th>成绩</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="object:${data}">
            <td th:text="${object.id}" ></td>
            <td th:text="${object.no}"></td>
            <td th:text="${object.name}"></td>
            <td th:text="${object.password}"></td>
            <td th:switch="${object.sex}" th:case="1">男</td>
            <td th:switch="${object.sex}" th:case="2">女</td>
            <td th:switch="${object.sex}" th:case="0">未知</td>
            <td th:text="${object.age}"></td>
            <td th:text="${object.score}"></td>
        </tr>
        </tbody>
    </table>
</div>


<!-- js片段 -->
<div th:fragment="scripts">

</div>

</html>